package com.dkt.android.api

import com.dkt.android.core.AppManager
import okhttp3.Interceptor
import okhttp3.Response
import java.io.IOException

class TokenInterceptord : Interceptor {


    @Throws(IOException::class)
    override fun intercept(chain: Interceptor.Chain): Response {
        val oldRequest = chain.request()
        val newRequest = oldRequest.newBuilder()
            .header(
                "token",  ""
//                "token", AppManager.instance.getUserContract()?.getToken() ?: ""
            )
            .header(
                "appName", "com.dkt.android"
            ).build()
        // 新的请求,添加参数
        return chain.proceed(newRequest)
    }

    private var head: String? = null
}